const app = new Vue({
    el: "#app",
    data(){
        return {
            city: "",
            weatherList: [],
        }
    },
    methods: {
            searchWeather: function(){
                console.log("event")
                let that = this;
                axios.get('http://wthrcdn.etouch.cn/weather_mini?city='+this.city)
                .then(function(response){
                    // console.dir(this);
                    console.log(response);
                    that.weatherList = response.data.data.forecast;

                })
                .catch(function(error){
                    console.log(error);
                })
            },
            clickWeather: function(event){
                // console.log(event.target.innerText);
                // this.city = event;
                this.city = event.target.innerText;
                this.searchWeather();
            }
    }
})